<include file="public:header" />
<div class="pad-10" >
    <form id="myform" name="myform" action="{:u('shop/delete')}" method="post" onsubmit="return check();">
        <div class="table-list">
            <table width="100%" cellspacing="0">
                <thead>
                    <tr>
                    	<th>ID</th>
                        <th width="4%"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>                        
                        <th>名称</th>
                        <th>LOGO</th>
                        <th>URL</th>
                        <th>添加时间</th>
                        <th>审核状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <volist name="list" id="val" >
                        <tr>
                        	<td align="center">{$val.id}</td>
                            <td align="center"><input type="checkbox" value="{$val.id}" name="id[]"></td>                            
                            <td align="center">{$val.title}</td>
                            <td align="center"><img src="__ROOT__/data/shop/{$val.img}" height="25px"/></td>
                            <td align="center">{$val.url}</td>
                            <td align="center">{$val.add_time}</td>
                            <td align="center" onclick="status({$val.id},'status')" id="status_{$val.id}">
                            	<img src="__ROOT__/statics/images/status_{$val.status}.gif" />
                          	</td>
                            <td align="center"><a class="blue" href="{:u('shop/edit',array('id'=>$val['id']))}">编辑</a></td>
                        </tr>
                    </volist>
                </tbody>
            </table>
            <div class="btn">
                <label for="check_box">全选/取消</label>
                <input type="submit" class="button" name="dosubmit" value="{$Think.lang.delete}" onclick="return confirm('{$Think.lang.sure_delete}')"/>
                <div id="pages">{$page}</div>
            </div>
        </div>
    </form>
</div>
<script language="javascript">
function edit(id, name) {
	var lang_edit = "{$Think.lang.edit}";
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({title:lang_edit+'--'+name,id:'edit',
						  iframe:'?iframe=1&m=shop&a=edit&id='+id,width:'700',height:'500'}, 
						  function(){
							  var d = window.top.art.dialog({id:'edit'}).data.iframe;
							  d.document.getElementById('dosubmit').click();
							  return false;
						}, 
						function(){
							window.top.art.dialog({id:'edit'}).close();
						});
}
function status(id,type){
    $.get("{:u('shop/status')}", {id:id, type: type }, function(data){
		$("#"+type+"_"+id+" img").attr('src', '__ROOT__/statics/images/status_'+data.data+'.gif')
	},'json'); 
}
</script>
</body></html>